#include <cstdio>


/**
 * 时间复杂度O(n)
 * 空间复杂度O(1)
 * 数组插入元素
 * @return 
 */
int main() {
    int arr[110]{};

    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
    }

    int x, y;
    scanf("%d %d", &x, &y);
    for (int i = n; i >= x; i--) {
        arr[i] = arr[i - 1];
    }
    arr[x-1] = y;
    
    for (int i = 0; i < n + 1; i++) {
        printf("%d ", arr[i]);
    }
    printf("\n");


    return 0;
}